package study.sharding.shardingjdbc.support.mybatis;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import javax.sql.DataSource;

@MapperScan("study.sharding.shardingjdbc.mapper")
@Slf4j
@Configuration
public class MybatisConfig {

    @Autowired
    private DataSource dataSource;

    @PostConstruct
    public void init() {
        log.info(">>>>>>");
        log.info(">>>>>> {}", dataSource.getClass().getSimpleName());
        log.info(">>>>>>");
    }
}
